package com.joint.core.dao.impl;

import com.fz.us.base.bean.BaseEnum.StateEnum;
import com.google.common.collect.Lists;
import com.joint.base.bean.FlowEnum.ProcessState;
import com.joint.base.dao.impl.BaseFlowDaoImpl;
import com.joint.core.dao.ProStartDao;
import com.joint.core.entity.ProStart;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Dao实现类 - 岗位
 * ============================================================================
 * 版权所有 2013 。
 * 
 * @author 
 * @version 0.1 2013-1-16
 * ============================================================================
 */

@Repository
public class ProStartDaoImpl extends BaseFlowDaoImpl<ProStart, String> implements ProStartDao {
    @Override
    public List<ProStart> findProAndFinish() {
        String hql = "from ProStart pro where pro.processState = ? and pro.state = ?";
        List<ProStart> proList = getSession().createQuery(hql).setParameter(0, ProcessState.Finished).setParameter(1,StateEnum.Enable).list();
        if(proList.size()>0){
            return proList;
        }else {
            return Lists.newArrayList();
        }

    }
}